package com.mccken.designpattern.factory.simple_factory.demo2;

import lombok.SneakyThrows;

/**
 * @program: mccken-collect
 * @description:
 * @author: mccken
 * @create: 2023-04-12 22:51
 **/
public class SimpleFactory {

	@SneakyThrows
	public static IProductDemo2 createProduct(Class<? extends IProductDemo2> clazz) {
		if (clazz == null) {
			return null;
		}
		return clazz.newInstance();
	}
}
